#!groovy
pipeline {
    agent any
    options {
        ansiColor(colorMapName: 'XTerm')
        disableConcurrentBuilds()
        timestamps()
    }
    parameters {
        string(name: 'version', defaultValue: '3.1.1', description: 'Teleport version to build')
    }
    stages {
        stage('Run Packer to build specified version') {
            steps {
                dir('assets/marketplace/cloudformation') {
                    sh "BUILD_AMI_NAME=cloudformation-gravitational-teleport-oss-${params.version} TELEPORT_VERSION=${params.version} make oss-jenkins-build"
                }
            }
        }
    }
}
